//
//  main.m
//  OC6_省市区限时代码66
//
//  Created by dllo on 15/11/2.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {

//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省名字", cityArr, @"市名字", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市名字", areaArr, @"区名字", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
   // 2
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//        NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//        [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//        NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    
//        NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//        NSLog(@"%@", str1);
    
    
    // 3
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//            NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    
//            NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//            NSLog(@"%@", str1);
    
    
    // 4
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//                NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    
//                NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//                NSLog(@"%@", str1);
    
    
    // 5
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
//    
//    
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    // 6
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    
    //            NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
    //
    //            NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    //            NSLog(@"%@", str1);
    
    
    
    // 7
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", cityArr, @"shi", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"shi", areaArr, @"qu", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    //  8
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    // 9
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    // 10
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"省", cityArr, @"市", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//
//                areaArr = [NSMutableArray array];
//                NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"市", areaArr, @"区", nil];
//                [cityArr addObject:cityDic];
//            } else {
//                [areaArr addObject:temp];
//            
//        }}
//    
//        NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//        NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//        NSLog(@"%@", str1);
    
    
    
    
    
    
    
    
//    NSString *str = [NSString stringWithContentsOfFile:@"" encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    NSMutableArray *pArr = [NSMutableArray array];
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *s = [arr objectAtIndex:i];
//        if (![s hasPrefix: @" "]) {
//            NSMutableArray *cArr = [NSMutableArray array];
//            NSMutableDictionary *pDic = [NSMutableDictionary dictionaryWithObjectsAndKeys:s, @"name", cArr, @"cArr", nil];
//            [pArr addObject:pDic];
//        }
//        else if (![s hasPrefix:@"   "]) {
//            NSMutableArray *cArr = [[pArr lastObject] objectForKey:@"cArr"];
//            NSMutableArray *aArr = [NSMutableArray array];
//            NSMutableDictionary *cDic = [NSMutableDictionary dictionaryWithObjectsAndKeys:s, @"name", aArr, @"aArr", nil];
//            [cArr addObject:cDic];
//        }
//        else {
//            
//            NSMutableArray *cArr = [[pArr lastObject] objectForKey:@"cArr"];
//            NSMutableArray *aArr = [[cArr lastObject] objectForKey:@"aArr"];
//            [aArr addObject:s];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:pArr options:(NSJSONWritingPrettyPrinted) error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", cityArr, @"shi", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", areaArr, @"shi", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", cityArr, @"shi", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", areaArr, @"shi", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng",  cityArr, @"shi", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng",  areaArr, @"shi", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    
//    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
//    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
//    NSArray *arr = [str componentsSeparatedByString:@"\n"];
//    NSMutableArray *proArr = [NSMutableArray array];
//    NSMutableArray *cityArr = nil;
//    NSMutableArray *areaArr = nil;
//    for (NSInteger i = 0; i < arr.count; i++) {
//        NSString *temp = [arr objectAtIndex:i];
//        if (![temp hasPrefix:@" "]) {
//            cityArr = [NSMutableArray array];
//            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", cityArr, @"shi", nil];
//            [proArr addObject:proDic];
//        } else if (![temp hasPrefix:@"   "]) {
//            areaArr = [NSMutableArray array];
//            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", areaArr, @"shi", nil];
//            [cityArr addObject:cityDic];
//        } else {
//            [areaArr addObject:temp];
//        }
//    }
//    
//    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
//    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//    NSLog(@"%@", str1);
    
    
    
    NSString *path = @"/Users/dllo/Desktop/省市区/area.txt";
    NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
    NSArray *arr = [str componentsSeparatedByString:@"\n"];
    NSMutableArray *proArr = [NSMutableArray array];
    NSMutableArray *cityArr = nil;
    NSMutableArray *areaArr = nil;
    for (NSInteger i = 0; i < arr.count; i++) {
        NSString *temp = [arr objectAtIndex:i];
        if (![temp hasPrefix:@" "]) {
            cityArr = [NSMutableArray array];
            NSMutableDictionary *proDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", cityArr, @"shi", nil];
            [proArr addObject:proDic];
        } else if (![temp hasPrefix:@"   "]) {
            areaArr = [NSMutableArray array];
            NSMutableDictionary *cityDic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:temp, @"sheng", areaArr, @"shi", nil];
            [cityArr addObject:cityDic];
        } else {
            [areaArr addObject:temp];
        }
    }
    
    NSData *data = [NSJSONSerialization dataWithJSONObject:proArr options:NSJSONWritingPrettyPrinted error:nil];
    NSString *str1 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    NSLog(@"%@", str1);
    
    
    
    
    
    
    
    
    
    return 0;
}
